﻿Imports DevExpress.XtraReports.UI

Public Class PreviewControl
    Private freport As New XtraReport
    Public Property report() As XtraReport
        Get
            Return freport
        End Get
        Set(ByVal value As XtraReport)
            freport = value
        End Set
    End Property

    Private dtreport As New DataTable
    Public Property DataSources() As DataTable
        Get
            Return dtreport
        End Get
        Set(ByVal value As DataTable)
            dtreport = value
        End Set
    End Property

    Private dsreportriwayat As New DataSet
    Public Property DataSourceRiwayat() As DataSet
        Get
            Return dsreportriwayat
        End Get
        Set(ByVal value As DataSet)
            dsreportriwayat = value
        End Set
    End Property

    Private dsreportkesehatan As New DataSet
    Public Property DataSourceKesehatan() As DataSet
        Get
            Return dsreportkesehatan
        End Get
        Set(ByVal value As DataSet)
            dsreportkesehatan = value
        End Set
    End Property

    Public Sub pre_Report()
        freport.DataSource = dtreport        
        freport.PrintingSystem = PrintingSystem1
        freport.CreateDocument()
    End Sub

    Public Sub pre_ReportRiwayat()
        'Dim ColumnNamekey As String
        'Dim dtrelation As DataRelation
        'Dim rptriwayat As New XtraReport1
        'ColumnNamekey = "nis"        
        'dtrelation = New DataRelation("relationsisri", dsreportriwayat.Tables("datasiswa").Columns(ColumnNamekey), dsreportriwayat.Tables("riwayatkesehatan").Columns(ColumnNamekey))
        'rptriwayat.DataSource = dsreportriwayat
        'rptriwayat.DataMember = "datasiswa"
        'rptriwayat.DetailReport.DataSource = dsreportriwayat
        'rptriwayat.DetailReport.DataMember = "riwidsiswa1"
        'rptriwayat.PrintingSystem = PrintingSystem1
        'Try
        '    rptriwayat.CreateDocument()
        'Catch ex As Exception
        'End Try
    End Sub

    Public Sub pre_ReportKesehatan()
        'Dim ColumnNamekey As String
        'Dim dtrelation As DataRelation
        'Dim rptkesehatan As New rptDATA_KESEHATAN
        ''ColumnNamekey = "nis"
        ''dtrelation = New DataRelation("riwidsiswa1", dsreportriwayat.Tables("datasiswa").Columns(ColumnNamekey), dsreportriwayat.Tables("riwayatkesehatan").Columns(ColumnNamekey))
        'rptkesehatan.DataSource = dsreportkesehatan
        'rptkesehatan.DataMember = "datasiswa"
        ''rptriwayat.DetailReport.DataSource = dsreportriwayat
        ''rptriwayat.DetailReport.DataMember = "riwidsiswa1"
        ''rptriwayat.PrintingSystem = PrintingSystem1
        'Try
        '    rptkesehatan.CreateDocument()
        'Catch ex As Exception
        'End Try
    End Sub

End Class
